{% extends "naimath_app/base.html" %}

{% load naimath_extras %}

{% block title %}Step3: Interrogation{% endblock %}

{% block body %}
<h2>Now I need to ask more specific questions.</h2>

<form method="POST" action="">
    {% csrf_token %}
    <h3>Previous Questions:</h3>
    {% for full_q_name, value in answers.iteritems %}
        {% if full_q_name != 'csrfmiddlewaretoken' %}
            {% with full_q_name|get_question as question %}
                {{question.question}}<br />
                {% for a_name, a_text in question.choices %}
                    {{ a_text }}
                    <input type="radio" name="{{ full_q_name }}" value="{{ a_name }}"
                       {% if a_name == value %}checked="checked"{% endif %} />
                    <br />
                {% endfor %}
            {% endwith %}
        {% endif %}
    {% endfor %}
    <h3>Diagnoses:</h3>
        {% for diagnosis, cf, _ in diagnosis %}
            <h4>{{ diagnosis }} ({{ cf|floatformat:2 }})</h4>
        {% endfor %}
    <h3>Questions:</h3>
        {% for full_q_name, relevance in questions %}
            {% with full_q_name|get_question as question %}
                {{ question.question }}({{ relevance|floatformat:2 }})<br />
                {% for a_name, a_text in question.choices %}
                    {{ a_text }}
                    <input type="radio" name="{{ full_q_name }}" value="{{ a_name }}" />
                    <br />
                {% endfor %}
            {% endwith %}
        {% endfor %}
    <input type="submit" />
</form>

<p><a href="/step4">Go to step4</a></p>
{% endblock %}
